package com.ruoyi.common.exception;

import com.ruoyi.common.enums.ResultCodeEnum;
import lombok.Data;

/**
 * @Author tang ao long
 * @Date 2020-09-03 14:50
 * @Version 1.0
 */
@Data
public class WebViewException extends RuntimeException  {

    private Integer code;

    /**
     * 接受状态码和消息
     * @param code
     * @param message
     */
    public WebViewException(Integer code, String message) {
        super(message);
        this.code=code;
    }

    /**
     * 接收枚举类型
     * @param resultCodeEnum
     */
    public WebViewException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "XHHospitalException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }

}
